#{extends 'overlay.html'/}

<h2 id="crudBlankTitle">Add a note to ${meeting.name}</h2>
	
<div class="objectForm">

<label for="object_name"> Note :</label> <br>
<textArea id="note_field" type="text"  rows ="5" cols="52" ></textArea> 
<span class="crudHelp" style="color:red">*</span>
</div>
<p class="crudButtons">
			<input type="button" value="Add note" onClick="add_note(${meeting.id})" />
</p>

<script type="text/javascript">

function add_note(id)
{
	var text= $('#note_field').val();
	if(text=="")
	{
		window.parent.$.bar({message:'Please enter a valid note.'});
	}
	else
	{
		$.post('/Meetings/addNote',{id:id , note:text},
				function(flag)
				{
					if(flag)
					{
						window.parent.$.bar({message:'Note successfully added'});
						window.parent.$('#getOverlay').hide();
						
					}
					else
					{
						window.parent.$.bar({message:'Please enter a valid note.'});
					}
				})
	}
}

</script>